UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C5djmbWzGfp5oOY3ZWpCAjfar3oHujhiB07Ug/w0Aek=' 
WHERE 
  key_id = 'e534d14b7eb804d1da3058072dc80f56b71ae8edcf855a053d02be715346cc89' 
  AND (
    token = 'C5djmbWzGfp5oOY3ZWpCAjfar3oHujhiB07Ug/w0Aek=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041