UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I3XuDzxfPNjuCsuMo9vqN2g4BUUq9LE+zo3DLsRCgAE=' 
WHERE 
  key_id = 'acfe81e1e8791818a10ee42708e02dbc67feb8c1a02377224de1c94936bd503e' 
  AND (
    token = 'I3XuDzxfPNjuCsuMo9vqN2g4BUUq9LE+zo3DLsRCgAE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053