UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Dr2TS2B/+v/dSs7uBrcNp7kqrtpG7BfU6hOhafweEJw=' 
WHERE 
  key_id = '6ec537936d7fed5625042ab502afbde9b0dfeb8db84a423a3deef6d6620514a0' 
  AND (
    token = 'Dr2TS2B/+v/dSs7uBrcNp7kqrtpG7BfU6hOhafweEJw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032