UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mPEvun+y4a7Jib1Z/h42SEMTOL65Gd+WmWbcZA+xsH0=' 
WHERE 
  key_id = '0bb0a4ae4154c8728847392591b222675b0591fc594c5700b12dd15baf29f87e' 
  AND (
    token = 'mPEvun+y4a7Jib1Z/h42SEMTOL65Gd+WmWbcZA+xsH0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024