UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XrKDbMGmJh1KIVHke12IlKaGKzyZa+Ld827sZL97fus=' 
WHERE 
  key_id = '6c6cce83e9ad6f489b3a88cf4c498f42b02ae709ece77a1c3bd42184087e090b' 
  AND (
    token = 'XrKDbMGmJh1KIVHke12IlKaGKzyZa+Ld827sZL97fus=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028