UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Es4tca6+tVUl962/KzPt+k/t71H4LYQZbulIdhUDezE=' 
WHERE 
  key_id = '5aa802a9f38363d08db6cf076ab3c8a04d413e22ce67cd2ef90546a15a7c0784' 
  AND (
    token = 'Es4tca6+tVUl962/KzPt+k/t71H4LYQZbulIdhUDezE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046