UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Sw0800oVSzYdc2gzowmNdsWwJ6fKzRoWk4AF45Z6gV4=' 
WHERE 
  key_id = '053f4cbeb14551b3d31438e0ca0253820e0c577f8abcd11d05cebfa0a6114dfa' 
  AND (
    token = 'Sw0800oVSzYdc2gzowmNdsWwJ6fKzRoWk4AF45Z6gV4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036