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

Query time 0.00044