UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5BSTit6PcGUPZsBB1CMTD+C4DM431D25qdn1fEzNMaw=' 
WHERE 
  key_id = '869d0dd897ba2c57b66e6fdee1dada2f387f2c083cf60ac9b30ad7f50904fe46' 
  AND (
    token = '5BSTit6PcGUPZsBB1CMTD+C4DM431D25qdn1fEzNMaw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030