UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Xhm07Mnc3qNiU5qFJ9pgngUPrEx2LyTIqfBWv1AHfFQ=' 
WHERE 
  key_id = '225ef168d03dfba9807d80d9c8793b9fb063a7dcaf2044dfcd04cb50b3b94e1f' 
  AND (
    token = 'Xhm07Mnc3qNiU5qFJ9pgngUPrEx2LyTIqfBWv1AHfFQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034