UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rBETLTMkqSWANphKgAuf9RE+ofJ/3yMMzg+JUMkU8r4=' 
WHERE 
  key_id = '6cde526affbd434c2b1a3f94628b88d882a9b067e4a329658a8f09486c101e5f' 
  AND (
    token = 'rBETLTMkqSWANphKgAuf9RE+ofJ/3yMMzg+JUMkU8r4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027