UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PN+pFRKMh/p5fdZPjPI4EpwsVxP6ix/Yy9MbPienXn8=' 
WHERE 
  key_id = 'b9fadb1cbd5b8390d7a00f627a057fb40c10c23cfe1a0d926c37ca22be3c438d' 
  AND (
    token = 'PN+pFRKMh/p5fdZPjPI4EpwsVxP6ix/Yy9MbPienXn8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034