UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't+2IJGnvxdohXMn4yTDL5ODtJQl7+GBWrNbpCL7s1xk=' 
WHERE 
  key_id = '8b698d5c3ce46f21d2b402808f7012a9e682bd2ffbd8c043c14b15f088a9c8d8' 
  AND (
    token = 't+2IJGnvxdohXMn4yTDL5ODtJQl7+GBWrNbpCL7s1xk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032