UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b1bh/QgsFKMZeE50tyzcizJErp0jVhNb2Tmi+i8PtJ4=' 
WHERE 
  key_id = '63df9315a442b20b5ac1e28c4fad7b76086f044f848463b6ed145ca66104d6b0' 
  AND (
    token = 'b1bh/QgsFKMZeE50tyzcizJErp0jVhNb2Tmi+i8PtJ4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024