UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4d7Xh47HZm0Dt6blyJAVujXKVNMg4BED6sB3JXV/C/c=' 
WHERE 
  key_id = 'c06fd00c58ffe13aee1d5624a46499a477cff0088119ec5cf77d9e52006b0094' 
  AND (
    token = '4d7Xh47HZm0Dt6blyJAVujXKVNMg4BED6sB3JXV/C/c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024