UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ittR6Fhwn9i8SmwPy/PVCN0camS/9lfZHiZ/43OpfNE=' 
WHERE 
  key_id = '05320cb687507972eef46e69007ee5c99941ce8c4e87e632c7adb143f743ca50' 
  AND (
    token = 'ittR6Fhwn9i8SmwPy/PVCN0camS/9lfZHiZ/43OpfNE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039