UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OCpDeA1GoSuAZ4ZOJQx2lRTLcwuz8X8jtTKr+k50n7A=' 
WHERE 
  key_id = 'cb291721d504bb3cf35fd38e8ee7a41d6d7b310ee920c15c4b6e7becea7ca8d9' 
  AND (
    token = 'OCpDeA1GoSuAZ4ZOJQx2lRTLcwuz8X8jtTKr+k50n7A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029